unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, BaseGrid, AdvGrid, Menus;

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    AdvGrid: TAdvStringGrid;
    FillAdvGrid1: TMenuItem;
    Execute1: TMenuItem;
    procedure FillAdvGrid1Click(Sender: TObject);
    procedure Execute1Click(Sender: TObject);
  private
    { Private declarations }
  protected
    procedure FillAdvGrid;
    procedure CutDoubles;
      
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

procedure TForm1.FillAdvGrid;
var
  I:Integer;
begin
  with AdvGrid do
  begin
    Cells[1,1]:='12.234';
    Cells[1,2]:='12.412';
    Cells[1,3]:='12.523';
    Cells[1,4]:='12.567';
    Cells[1,5]:='12.454';

  end;
end;

procedure TForm1.FillAdvGrid1Click(Sender: TObject);
begin
  FillAdvGrid;
end;

procedure TForm1.Execute1Click(Sender: TObject);
begin
  CutDoubles;
end;

procedure TForm1.CutDoubles;
var
  I:Integer;
  SourceValue,TargetValue:Double;

begin
  with AdvGrid do
  begin
    for I:=1 to RowCount-1 do
    begin
      SourceValue:=StrToFloat(Cells[1,I]);

      SourceValue:=SourceValue * 100 +0.5;
      SourceValue:=Trunc(SourceValue)/100;
      Cells[2,I]:=FloatToStr(SourceValue);
    end;
  end;
end;

end.
